package com.wslNB.goods;



import com.wslNB.utils.IdWorker;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import tk.mybatis.spring.annotation.MapperScan;

/*
商品微服务service
 */
@SpringBootApplication
@EnableEurekaClient
@MapperScan("com.wslNB.goods.dao")
@ComponentScan(basePackages = "com.wslNB")
public class GoodsAPP {
    
    public static void main(String[] args) {
        SpringApplication.run(GoodsAPP.class,args);
    }

    //工作机器id
    @Value("${workerId}")
    private Integer workerId;
    //实例id
    @Value("${datacenterId}")
    private Integer datacenterId;

    @Bean
    public IdWorker idWorker(){
        return new IdWorker(workerId,datacenterId);
    }


}
